home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / emerald / emrldsys.lha / Language / Compiler / datadesc.h < prev    next >
C/C++ Source or Header  |  1990-08-16  |  3KB  |  110 lines

  1. /*
  2.  * @(#)datadesc.h    1.6  4/11/88
  3.  */
  4. #ifndef datadesc_h
  5. #define datadesc_h
  6.  
  7. #ifndef addresses_h
  8. #include "addresses.h"
  9. #endif
  10.  
  11. #ifndef types_h
  12. #include "types.h"
  13. #endif
  14.  
  15. #ifndef ecTypes_h
  16. #include "ecTypes.h"
  17. #endif
  18.  
  19. typedef enum { R_Temporary, R_Allocatable, R_Linkage} RegisterKinds;
  20.  
  21. typedef enum { DD_Address, DD_Manifest, DD_PSLCondition, DD_AbCon,
  22.            DD_OIDToODP, DD_OIDToODAP, DD_OIDToCodePtr, DD_Label, DD_Self,
  23.            DD_RealManifest } DD_Kind;
  24. typedef enum { NEQ, EQL, GTR, LEQ, GEQ, LSS, 
  25.            GTRU, LEQU, VC, VS, GEQU, LSSU, PL, MI, ALWAYS, SUBR } PSLCondition;
  26.  
  27. #define NEQU NEQ
  28. #define EQLU EQL
  29. #define CC GEQU
  30. #define CS LSSU
  31.  
  32. extern PSLCondition negatedConditions[];
  33. extern PSLCondition reversedConditions[];
  34. extern char *PSLConditionName[];
  35. #define JN(S) PSLConditionName[(int)(S)]
  36. #define JF(S) ((S) ? FLOATJUMPCHAR : "")
  37. #define TS_Stack    1
  38. #define TS_PSL        2
  39. #define TS_Self        4
  40. #define TS_Label    8
  41. #define TS_All        15
  42.  
  43. typedef struct sDataDescriptor {
  44.   DD_Kind        kind:8;
  45.   unsigned int        ATOID:24;
  46.   union {
  47.     Address        address;
  48.     int            manifest;
  49.     char           *realmanifest;
  50.     struct {
  51.       PSLCondition    psl:16;
  52.       Boolean        isFloat:16;
  53.     } condition;
  54.     OID            CTOID;
  55.     OID            id;
  56.     int            label;
  57.   } value;
  58. } DD, *DDPtr;
  59.  
  60. #define getDDAbstractType(X) ((OID) ((X).ATOID | 0xff000000))
  61. #define getDDConcreteType(X) ((OID) (X).value.CTOID)
  62.  
  63. #define setDDAbstractType(X, ID) ((X).ATOID = (ID) & ~0xff000000)
  64. #define setDDConcreteType(X, ID) ((X).value.CTOID = (ID))
  65.  
  66. typedef struct Variable {
  67.   DD            data;
  68.   DD            abCon;
  69. } Variable, *VariablePtr;
  70.  
  71. extern Variable vStack[];
  72. extern VariablePtr vStackTop;
  73. extern void vForceToTemp();
  74. extern void vPush(), vPushSymbol(), vSwap(), vGenerateAssign(), vPushValue(),
  75.         vPushVariable(), ddGenerateAssign(), vPushDD(), vPushOwnName(),
  76.         vPushOwnType();
  77. extern DD vGetSymbolAbCon();
  78. extern Variable vPop(), vTop();
  79. extern DD vPopData(), vPopAbCon();
  80. extern DD vTopData(), vTopAbCon();
  81. extern Boolean vEmpty();
  82. extern Variable *vPeek();
  83. extern void vDiscard(), vDiscardN();
  84. extern DD nextAddress();
  85. extern Boolean isNextAddress(), isSameDD();
  86. extern int allocateReg();
  87. extern void claimReg();
  88. extern void freeAllRegs(), freeReg(), preemptReg(), preemptKernelRegisters();
  89. extern void TS_startOperation(), TS_endOperation(), TS_Free();
  90. extern int TS_Allocate();
  91. extern void TS_StartInvocation(), TS_Results(), TS_Push(), TS_EndInvocation(),
  92.     TS_fixSPForHandler();
  93. /*
  94.  * Contexts for generating expressions.  Basically, there are times when we
  95.  * want to take advantage of context information.  Such as puting the result
  96.  * of an invocation in the right place, generating psl conditions in a
  97.  * branching context, etc.
  98.  */
  99.  
  100. typedef enum { C_Any, C_PSL, C_Variable } ContextKind;
  101.  
  102. typedef struct Context {
  103.   ContextKind        kind;
  104.   Variable        v;
  105. } Context, *ContextPtr;
  106.  
  107. extern Context anyContext, pslContext, pusherContext;
  108.  
  109. #endif
  110.